﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="dsProjectos" targetNamespace="http://tempuri.org/dsProjectos.xsd" xmlns:mstns="http://tempuri.org/dsProjectos.xsd" xmlns="http://tempuri.org/dsProjectos.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="MySettings" AppSettingsPropertyName="SamecaGestConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="SamecaGestConnectionString (MySettings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.SamecaGestV2.My.MySettings.GlobalReference.Default.SamecaGestConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="tblProjectosTableAdapter" GeneratorDataComponentClassName="tblProjectosTableAdapter" Name="tblProjectos" UserDataComponentName="tblProjectosTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectName="SAMECAGEST.dbo.tblProjectos" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>DELETE FROM [tblProjectos] WHERE (([ano] = @Original_ano) AND ([Code] = @Original_Code) AND ((@IsNull_Descricao = 1 AND [Descricao] IS NULL) OR ([Descricao] = @Original_Descricao)) AND ([Company] = @Original_Company) AND ((@IsNull_un = 1 AND [un] IS NULL) OR ([un] = @Original_un)))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_ano" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ano" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Code" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Code" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_Descricao" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Descricao" SourceColumnNullMapping="true" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Descricao" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Descricao" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Company" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Company" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_un" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="un" SourceColumnNullMapping="true" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_un" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="un" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>INSERT INTO [tblProjectos] ([ano], [Code], [Descricao], [Company], [un]) VALUES (@ano, @Code, @Descricao, @Company, @un)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@ano" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ano" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Code" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Code" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Descricao" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Descricao" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Company" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Company" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@un" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="un" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        ano, Code, Descricao, Company, un
FROM            tblProjectos
WHERE        (ano = @ano) AND (Company = @company) AND (un LIKE @un)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="true" AutogeneratedName="ano" ColumnName="ano" DataSourceName="SAMECAGEST.dbo.tblProjectos" DataTypeServer="varchar(4)" DbType="AnsiString" Direction="Input" ParameterName="@ano" Precision="0" ProviderType="VarChar" Scale="0" Size="4" SourceColumn="ano" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="company" ColumnName="Company" DataSourceName="SAMECAGEST.dbo.tblProjectos" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@company" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="Company" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="un" ColumnName="un" DataSourceName="SAMECAGEST.dbo.tblProjectos" DataTypeServer="varchar(2)" DbType="AnsiString" Direction="Input" ParameterName="@un" Precision="0" ProviderType="VarChar" Scale="0" Size="2" SourceColumn="un" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>UPDATE [tblProjectos] SET [ano] = @ano, [Code] = @Code, [Descricao] = @Descricao, [Company] = @Company, [un] = @un WHERE (([ano] = @Original_ano) AND ([Code] = @Original_Code) AND ((@IsNull_Descricao = 1 AND [Descricao] IS NULL) OR ([Descricao] = @Original_Descricao)) AND ([Company] = @Original_Company) AND ((@IsNull_un = 1 AND [un] IS NULL) OR ([un] = @Original_un)))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@ano" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ano" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Code" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Code" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Descricao" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Descricao" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Company" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Company" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@un" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="un" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_ano" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ano" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Code" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Code" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_Descricao" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Descricao" SourceColumnNullMapping="true" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Descricao" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Descricao" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Company" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Company" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_un" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="un" SourceColumnNullMapping="true" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_un" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="un" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="ano" DataSetColumn="ano" />
              <Mapping SourceColumn="Code" DataSetColumn="Code" />
              <Mapping SourceColumn="Descricao" DataSetColumn="Descricao" />
              <Mapping SourceColumn="Company" DataSetColumn="Company" />
              <Mapping SourceColumn="un" DataSetColumn="un" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="tblProjectosProdutoTableAdapter" GeneratorDataComponentClassName="tblProjectosProdutoTableAdapter" Name="tblProjectosProduto" UserDataComponentName="tblProjectosProdutoTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        tblProjectosProduto.id, tblProjectosProduto.ano, tblProjectosProduto.[Code Produto], tblProjectosProduto.[Code Projecto], tblProjectos.Descricao, 
                         tblProjectosProduto.Company, tblProjectos.un, tblUsers.PrimeiroNome + ' ' + tblUsers.UltimoNome AS GESTOR
FROM            tblProjectos INNER JOIN
                         tblProjectosProduto ON tblProjectos.ano = tblProjectosProduto.ano AND tblProjectos.Company = tblProjectosProduto.Company AND 
                         tblProjectos.Code = tblProjectosProduto.[Code Projecto] INNER JOIN
                         tblUsers ON tblProjectos.un = tblUsers.CodGestProd
WHERE        (tblProjectosProduto.ano = @ano) AND (tblProjectosProduto.Company = @company)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="true" AutogeneratedName="ano" ColumnName="ano" DataSourceName="SAMECAGEST.dbo.tblProjectosProduto" DataTypeServer="varchar(4)" DbType="AnsiString" Direction="Input" ParameterName="@ano" Precision="0" ProviderType="VarChar" Scale="0" Size="4" SourceColumn="ano" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="company" ColumnName="Company" DataSourceName="SAMECAGEST.dbo.tblProjectosProduto" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@company" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="Company" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="ano" DataSetColumn="ano" />
              <Mapping SourceColumn="Code Produto" DataSetColumn="Code Produto" />
              <Mapping SourceColumn="Code Projecto" DataSetColumn="Code Projecto" />
              <Mapping SourceColumn="Descricao" DataSetColumn="Descricao" />
              <Mapping SourceColumn="Company" DataSetColumn="Company" />
              <Mapping SourceColumn="un" DataSetColumn="un" />
              <Mapping SourceColumn="GESTOR" DataSetColumn="GESTOR" />
              <Mapping SourceColumn="id" DataSetColumn="id" />
            </Mappings>
            <Sources>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="InsertQuery" Modifier="Public" Name="InsertQuery" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy" UserSourceName="InsertQuery">
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>INSERT INTO tblProjectosProduto
                         (ano, [Code Produto], [Code Projecto], Company)
VALUES        (@ano,@codprod,@codproject,@company)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="true" AutogeneratedName="ano" ColumnName="ano" DataSourceName="SAMECAGEST.dbo.tblProjectosProduto" DataTypeServer="varchar(4)" DbType="AnsiString" Direction="Input" ParameterName="@ano" Precision="0" ProviderType="VarChar" Scale="0" Size="4" SourceColumn="ano" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="codprod" ColumnName="Code Produto" DataSourceName="SAMECAGEST.dbo.tblProjectosProduto" DataTypeServer="varchar(20)" DbType="AnsiString" Direction="Input" ParameterName="@codprod" Precision="0" ProviderType="VarChar" Scale="0" Size="20" SourceColumn="Code Produto" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="codproject" ColumnName="Code Projecto" DataSourceName="SAMECAGEST.dbo.tblProjectosProduto" DataTypeServer="varchar(4)" DbType="AnsiString" Direction="Input" ParameterName="@codproject" Precision="0" ProviderType="VarChar" Scale="0" Size="4" SourceColumn="Code Projecto" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="company" ColumnName="Company" DataSourceName="SAMECAGEST.dbo.tblProjectosProduto" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@company" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="Company" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
              </DbSource>
            </Sources>
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="tblItemTableAdapter" GeneratorDataComponentClassName="tblItemTableAdapter" Name="tblItem" UserDataComponentName="tblItemTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectName="SAMECAGEST.dbo.tblItem" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        No_, [Extended Description]
FROM            tblItem
WHERE        (Company = @company)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="company" ColumnName="Company" DataSourceName="SAMECAGEST.dbo.tblItem" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@company" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="Company" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="No_" DataSetColumn="No_" />
              <Mapping SourceColumn="Extended Description" DataSetColumn="Extended Description" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="RProjectosTableAdapter" GeneratorDataComponentClassName="RProjectosTableAdapter" Name="RProjectos" UserDataComponentName="RProjectosTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectName="SAMECAGEST.dbo.tblProjectos" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        tblProjectos.Code, tblProjectos.Descricao, SUM(ORC.[QD-1]) AS [QD-1], SUM(ORC.[VD-1]) AS [VD-1], SUM(ORC.[MRG-1]) AS [MRG-1], SUM(ORC.QD) AS QD, 
                         SUM(ORC.VD) AS VD, SUM(ORC.MRG) AS MRG, SUM(ORC.[QD-ORC]) AS [QD-ORC], SUM(ORC.[VD-ORC]) AS [VD-ORC], SUM(ORC.[MRG-ORC]) 
                         AS [MRG-ORC]
FROM            tblProjectos LEFT OUTER JOIN
                         tblProjectosProduto ON tblProjectos.ano = tblProjectosProduto.ano AND tblProjectos.Code = tblProjectosProduto.[Code Projecto] AND 
                         tblProjectos.Company = tblProjectosProduto.Company LEFT OUTER JOIN
                             (SELECT        tblOrcamento_1.ANO, tblOrcamento_1.CODCLI, tblOrcamento_1.CODPROD, tblOrcamento_1.Armazem, tblOrcamento_1.[QD-1], 
                                                         tblOrcamento_1.[VD-1], tblOrcamento_1.[MRG-1], tblOrcamento_1.QD, tblOrcamento_1.VD, tblOrcamento_1.MRG, tblOrcamento_1.[QD-ORC], 
                                                         tblOrcamento_1.[PVD-ORC] * tblOrcamento_1.[QD-ORC] AS [VD-ORC], 
                                                         tblOrcamento_1.[PVD-ORC] * tblOrcamento_1.[QD-ORC] - CASE WHEN tblPrecoCustoOrcamento.PCtSugerido &lt;&gt; 0 THEN tblPrecoCustoOrcamento.PCtSugerido
                                                          ELSE tblPrecoCustoOrcamento.PCtReal END * tblOrcamento_1.[QD-ORC] AS [MRG-ORC]
                               FROM            tblOrcamento AS tblOrcamento_1 INNER JOIN
                                                         tblPrecoCustoOrcamento ON tblOrcamento_1.ANO = tblPrecoCustoOrcamento.Ano AND 
                                                         tblOrcamento_1.CODPROD = tblPrecoCustoOrcamento.CodProd) AS ORC ON tblProjectosProduto.ano = ORC.ANO AND 
                         tblProjectosProduto.[Code Produto] = ORC.CODPROD
WHERE        (tblProjectos.ano = @ano) AND (tblProjectos.Company = @company)
GROUP BY tblProjectos.Code, tblProjectos.Descricao</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="ano" ColumnName="ano" DataSourceName="SAMECAGEST.dbo.tblProjectos" DataTypeServer="varchar(4)" DbType="AnsiString" Direction="Input" ParameterName="@ano" Precision="0" ProviderType="VarChar" Scale="0" Size="4" SourceColumn="ano" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="company" ColumnName="Company" DataSourceName="SAMECAGEST.dbo.tblProjectos" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@company" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="Company" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Code" DataSetColumn="Code" />
              <Mapping SourceColumn="Descricao" DataSetColumn="Descricao" />
              <Mapping SourceColumn="QD-1" DataSetColumn="QD-1" />
              <Mapping SourceColumn="VD-1" DataSetColumn="VD-1" />
              <Mapping SourceColumn="MRG-1" DataSetColumn="MRG-1" />
              <Mapping SourceColumn="QD" DataSetColumn="QD" />
              <Mapping SourceColumn="VD" DataSetColumn="VD" />
              <Mapping SourceColumn="MRG" DataSetColumn="MRG" />
              <Mapping SourceColumn="QD-ORC" DataSetColumn="QD-ORC" />
              <Mapping SourceColumn="VD-ORC" DataSetColumn="VD-ORC" />
              <Mapping SourceColumn="MRG-ORC" DataSetColumn="MRG-ORC" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="RProjectosProdutosTableAdapter" GeneratorDataComponentClassName="RProjectosProdutosTableAdapter" Name="RProjectosProdutos" UserDataComponentName="RProjectosProdutosTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SamecaGestConnectionString (MySettings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        tblProjectos.Code, tblProjectos.Descricao, tblProjectosProduto.[Code Produto], tblItem.[Extended Description], SUM(ORC.[QD-1]) AS [QD-1], SUM(ORC.[VD-1]) 
                         AS [VD-1], SUM(ORC.[MRG-1]) AS [MRG-1], SUM(ORC.QD) AS QD, SUM(ORC.VD) AS VD, SUM(ORC.MRG) AS MRG, SUM(ORC.[QD-ORC]) AS [QD-ORC], 
                         SUM(ORC.[VD-ORC]) AS [VD-ORC], SUM(ORC.[MRG-ORC]) AS [MRG-ORC]
FROM            tblProjectosProduto LEFT OUTER JOIN
                         tblItem ON tblProjectosProduto.[Code Produto] = tblItem.No_ RIGHT OUTER JOIN
                         tblProjectos ON tblProjectosProduto.ano = tblProjectos.ano AND tblProjectosProduto.[Code Projecto] = tblProjectos.Code AND 
                         tblProjectosProduto.Company = tblProjectos.Company AND tblItem.Company = tblProjectos.Company LEFT OUTER JOIN
                             (SELECT        tblOrcamento_1.ANO, tblOrcamento_1.CODCLI, tblOrcamento_1.CODPROD, tblOrcamento_1.Armazem, tblOrcamento_1.[QD-1], 
                                                         tblOrcamento_1.[VD-1], tblOrcamento_1.[MRG-1], tblOrcamento_1.QD, tblOrcamento_1.VD, tblOrcamento_1.MRG, tblOrcamento_1.[QD-ORC], 
                                                         tblOrcamento_1.[PVD-ORC] * tblOrcamento_1.[QD-ORC] AS [VD-ORC], 
                                                         tblOrcamento_1.[PVD-ORC] * tblOrcamento_1.[QD-ORC] - CASE WHEN tblPrecoCustoOrcamento.PCtSugerido &lt;&gt; 0 THEN tblPrecoCustoOrcamento.PCtSugerido
                                                          ELSE tblPrecoCustoOrcamento.PCtReal END * tblOrcamento_1.[QD-ORC] AS [MRG-ORC]
                               FROM            tblOrcamento AS tblOrcamento_1 INNER JOIN
                                                         tblPrecoCustoOrcamento ON tblOrcamento_1.ANO = tblPrecoCustoOrcamento.Ano AND 
                                                         tblOrcamento_1.CODPROD = tblPrecoCustoOrcamento.CodProd) AS ORC ON tblProjectosProduto.ano = ORC.ANO AND 
                         tblProjectosProduto.[Code Produto] = ORC.CODPROD
WHERE        (tblProjectos.ano = @ano) AND (tblProjectos.Company = @company)
GROUP BY tblProjectos.Code, tblProjectos.Descricao, tblProjectosProduto.[Code Produto], tblItem.[Extended Description]</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="ano" ColumnName="ano" DataSourceName="SAMECAGEST.dbo.tblProjectos" DataTypeServer="varchar(4)" DbType="AnsiString" Direction="Input" ParameterName="@ano" Precision="0" ProviderType="VarChar" Scale="0" Size="4" SourceColumn="ano" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="company" ColumnName="Company" DataSourceName="SAMECAGEST.dbo.tblProjectos" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@company" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="Company" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Code" DataSetColumn="Code" />
              <Mapping SourceColumn="Descricao" DataSetColumn="Descricao" />
              <Mapping SourceColumn="Code Produto" DataSetColumn="Code Produto" />
              <Mapping SourceColumn="Extended Description" DataSetColumn="Extended Description" />
              <Mapping SourceColumn="QD-1" DataSetColumn="QD-1" />
              <Mapping SourceColumn="VD-1" DataSetColumn="VD-1" />
              <Mapping SourceColumn="MRG-1" DataSetColumn="MRG-1" />
              <Mapping SourceColumn="QD" DataSetColumn="QD" />
              <Mapping SourceColumn="VD" DataSetColumn="VD" />
              <Mapping SourceColumn="MRG" DataSetColumn="MRG" />
              <Mapping SourceColumn="QD-ORC" DataSetColumn="QD-ORC" />
              <Mapping SourceColumn="VD-ORC" DataSetColumn="VD-ORC" />
              <Mapping SourceColumn="MRG-ORC" DataSetColumn="MRG-ORC" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="dsProjectos" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="dsProjectos" msprop:Generator_UserDSName="dsProjectos">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="tblProjectos" msprop:Generator_TableClassName="tblProjectosDataTable" msprop:Generator_TableVarName="tabletblProjectos" msprop:Generator_TablePropName="tblProjectos" msprop:Generator_RowDeletingName="tblProjectosRowDeleting" msprop:Generator_RowChangingName="tblProjectosRowChanging" msprop:Generator_RowEvHandlerName="tblProjectosRowChangeEventHandler" msprop:Generator_RowDeletedName="tblProjectosRowDeleted" msprop:Generator_UserTableName="tblProjectos" msprop:Generator_RowChangedName="tblProjectosRowChanged" msprop:Generator_RowEvArgName="tblProjectosRowChangeEvent" msprop:Generator_RowClassName="tblProjectosRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ano" msprop:Generator_ColumnVarNameInTable="columnano" msprop:Generator_ColumnPropNameInRow="ano" msprop:Generator_ColumnPropNameInTable="anoColumn" msprop:Generator_UserColumnName="ano" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="4" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Code" msprop:Generator_ColumnVarNameInTable="columnCode" msprop:Generator_ColumnPropNameInRow="Code" msprop:Generator_ColumnPropNameInTable="CodeColumn" msprop:Generator_UserColumnName="Code">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="4" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Descricao" msprop:Generator_ColumnVarNameInTable="columnDescricao" msprop:Generator_ColumnPropNameInRow="Descricao" msprop:Generator_ColumnPropNameInTable="DescricaoColumn" msprop:Generator_UserColumnName="Descricao" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Company" msprop:Generator_ColumnVarNameInTable="columnCompany" msprop:Generator_ColumnPropNameInRow="Company" msprop:Generator_ColumnPropNameInTable="CompanyColumn" msprop:Generator_UserColumnName="Company" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="un" msprop:Generator_ColumnVarNameInTable="columnun" msprop:Generator_ColumnPropNameInRow="un" msprop:Generator_ColumnPropNameInTable="unColumn" msprop:Generator_UserColumnName="un" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="tblProjectosProduto" msprop:Generator_TableClassName="tblProjectosProdutoDataTable" msprop:Generator_TableVarName="tabletblProjectosProduto" msprop:Generator_RowChangedName="tblProjectosProdutoRowChanged" msprop:Generator_TablePropName="tblProjectosProduto" msprop:Generator_RowDeletingName="tblProjectosProdutoRowDeleting" msprop:Generator_RowChangingName="tblProjectosProdutoRowChanging" msprop:Generator_RowEvHandlerName="tblProjectosProdutoRowChangeEventHandler" msprop:Generator_RowDeletedName="tblProjectosProdutoRowDeleted" msprop:Generator_RowClassName="tblProjectosProdutoRow" msprop:Generator_UserTableName="tblProjectosProduto" msprop:Generator_RowEvArgName="tblProjectosProdutoRowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ano" msprop:Generator_ColumnVarNameInTable="columnano" msprop:Generator_ColumnPropNameInRow="ano" msprop:Generator_ColumnPropNameInTable="anoColumn" msprop:Generator_UserColumnName="ano" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="4" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Code_x0020_Produto" msprop:Generator_ColumnVarNameInTable="columnCode_Produto" msprop:Generator_ColumnPropNameInRow="Code_Produto" msprop:Generator_ColumnPropNameInTable="Code_ProdutoColumn" msprop:Generator_UserColumnName="Code Produto" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Code_x0020_Projecto" msprop:Generator_ColumnVarNameInTable="columnCode_Projecto" msprop:Generator_ColumnPropNameInRow="Code_Projecto" msprop:Generator_ColumnPropNameInTable="Code_ProjectoColumn" msprop:Generator_UserColumnName="Code Projecto" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="4" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Descricao" msprop:Generator_ColumnVarNameInTable="columnDescricao" msprop:Generator_ColumnPropNameInRow="Descricao" msprop:Generator_ColumnPropNameInTable="DescricaoColumn" msprop:Generator_UserColumnName="Descricao" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Company" msprop:Generator_ColumnVarNameInTable="columnCompany" msprop:Generator_ColumnPropNameInRow="Company" msprop:Generator_ColumnPropNameInTable="CompanyColumn" msprop:Generator_UserColumnName="Company" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="un" msprop:Generator_ColumnVarNameInTable="columnun" msprop:Generator_ColumnPropNameInRow="un" msprop:Generator_ColumnPropNameInTable="unColumn" msprop:Generator_UserColumnName="un" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="GESTOR" msprop:Generator_ColumnVarNameInTable="columnGESTOR" msprop:Generator_ColumnPropNameInRow="GESTOR" msprop:Generator_ColumnPropNameInTable="GESTORColumn" msprop:Generator_UserColumnName="GESTOR" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="103" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="id" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnid" msprop:Generator_ColumnPropNameInRow="id" msprop:Generator_ColumnPropNameInTable="idColumn" msprop:Generator_UserColumnName="id" type="xs:int" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="tblItem" msprop:Generator_TableClassName="tblItemDataTable" msprop:Generator_TableVarName="tabletblItem" msprop:Generator_RowChangedName="tblItemRowChanged" msprop:Generator_TablePropName="tblItem" msprop:Generator_RowDeletingName="tblItemRowDeleting" msprop:Generator_RowChangingName="tblItemRowChanging" msprop:Generator_RowEvHandlerName="tblItemRowChangeEventHandler" msprop:Generator_RowDeletedName="tblItemRowDeleted" msprop:Generator_RowClassName="tblItemRow" msprop:Generator_UserTableName="tblItem" msprop:Generator_RowEvArgName="tblItemRowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="No_" msprop:Generator_ColumnVarNameInTable="columnNo_" msprop:Generator_ColumnPropNameInRow="No_" msprop:Generator_ColumnPropNameInTable="No_Column" msprop:Generator_UserColumnName="No_">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Extended_x0020_Description" msprop:Generator_ColumnVarNameInTable="columnExtended_Description" msprop:Generator_ColumnPropNameInRow="Extended_Description" msprop:Generator_ColumnPropNameInTable="Extended_DescriptionColumn" msprop:Generator_UserColumnName="Extended Description" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="RProjectos" msprop:Generator_TableClassName="RProjectosDataTable" msprop:Generator_TableVarName="tableRProjectos" msprop:Generator_TablePropName="RProjectos" msprop:Generator_RowDeletingName="RProjectosRowDeleting" msprop:Generator_RowChangingName="RProjectosRowChanging" msprop:Generator_RowEvHandlerName="RProjectosRowChangeEventHandler" msprop:Generator_RowDeletedName="RProjectosRowDeleted" msprop:Generator_UserTableName="RProjectos" msprop:Generator_RowChangedName="RProjectosRowChanged" msprop:Generator_RowEvArgName="RProjectosRowChangeEvent" msprop:Generator_RowClassName="RProjectosRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Code" msprop:Generator_ColumnVarNameInTable="columnCode" msprop:Generator_ColumnPropNameInRow="Code" msprop:Generator_ColumnPropNameInTable="CodeColumn" msprop:Generator_UserColumnName="Code">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="4" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Descricao" msprop:Generator_ColumnVarNameInTable="columnDescricao" msprop:Generator_ColumnPropNameInRow="Descricao" msprop:Generator_ColumnPropNameInTable="DescricaoColumn" msprop:Generator_UserColumnName="Descricao" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="QD-1" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="_columnQD_1" msprop:Generator_ColumnPropNameInRow="_QD_1" msprop:Generator_ColumnPropNameInTable="_QD_1Column" msprop:Generator_UserColumnName="QD-1" type="xs:decimal" minOccurs="0" />
              <xs:element name="VD-1" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="_columnVD_1" msprop:Generator_ColumnPropNameInRow="_VD_1" msprop:Generator_ColumnPropNameInTable="_VD_1Column" msprop:Generator_UserColumnName="VD-1" type="xs:decimal" minOccurs="0" />
              <xs:element name="MRG-1" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="_columnMRG_1" msprop:Generator_ColumnPropNameInRow="_MRG_1" msprop:Generator_ColumnPropNameInTable="_MRG_1Column" msprop:Generator_UserColumnName="MRG-1" type="xs:decimal" minOccurs="0" />
              <xs:element name="QD" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnQD" msprop:Generator_ColumnPropNameInRow="QD" msprop:Generator_ColumnPropNameInTable="QDColumn" msprop:Generator_UserColumnName="QD" type="xs:decimal" minOccurs="0" />
              <xs:element name="VD" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnVD" msprop:Generator_ColumnPropNameInRow="VD" msprop:Generator_ColumnPropNameInTable="VDColumn" msprop:Generator_UserColumnName="VD" type="xs:decimal" minOccurs="0" />
              <xs:element name="MRG" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnMRG" msprop:Generator_ColumnPropNameInRow="MRG" msprop:Generator_ColumnPropNameInTable="MRGColumn" msprop:Generator_UserColumnName="MRG" type="xs:decimal" minOccurs="0" />
              <xs:element name="QD-ORC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="_columnQD_ORC" msprop:Generator_ColumnPropNameInRow="_QD_ORC" msprop:Generator_ColumnPropNameInTable="_QD_ORCColumn" msprop:Generator_UserColumnName="QD-ORC" type="xs:decimal" minOccurs="0" />
              <xs:element name="VD-ORC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="_columnVD_ORC" msprop:Generator_ColumnPropNameInRow="_VD_ORC" msprop:Generator_ColumnPropNameInTable="_VD_ORCColumn" msprop:Generator_UserColumnName="VD-ORC" type="xs:decimal" minOccurs="0" />
              <xs:element name="MRG-ORC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="_columnMRG_ORC" msprop:Generator_ColumnPropNameInRow="_MRG_ORC" msprop:Generator_ColumnPropNameInTable="_MRG_ORCColumn" msprop:Generator_UserColumnName="MRG-ORC" type="xs:decimal" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="RProjectosProdutos" msprop:Generator_TableClassName="RProjectosProdutosDataTable" msprop:Generator_TableVarName="tableRProjectosProdutos" msprop:Generator_TablePropName="RProjectosProdutos" msprop:Generator_RowDeletingName="RProjectosProdutosRowDeleting" msprop:Generator_RowChangingName="RProjectosProdutosRowChanging" msprop:Generator_RowEvHandlerName="RProjectosProdutosRowChangeEventHandler" msprop:Generator_RowDeletedName="RProjectosProdutosRowDeleted" msprop:Generator_UserTableName="RProjectosProdutos" msprop:Generator_RowChangedName="RProjectosProdutosRowChanged" msprop:Generator_RowEvArgName="RProjectosProdutosRowChangeEvent" msprop:Generator_RowClassName="RProjectosProdutosRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Code" msprop:Generator_ColumnVarNameInTable="columnCode" msprop:Generator_ColumnPropNameInRow="Code" msprop:Generator_ColumnPropNameInTable="CodeColumn" msprop:Generator_UserColumnName="Code">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="4" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Descricao" msprop:Generator_ColumnVarNameInTable="columnDescricao" msprop:Generator_ColumnPropNameInRow="Descricao" msprop:Generator_ColumnPropNameInTable="DescricaoColumn" msprop:Generator_UserColumnName="Descricao" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Code_x0020_Produto" msprop:Generator_ColumnVarNameInTable="columnCode_Produto" msprop:Generator_ColumnPropNameInRow="Code_Produto" msprop:Generator_ColumnPropNameInTable="Code_ProdutoColumn" msprop:Generator_UserColumnName="Code Produto" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Extended_x0020_Description" msprop:Generator_ColumnVarNameInTable="columnExtended_Description" msprop:Generator_ColumnPropNameInRow="Extended_Description" msprop:Generator_ColumnPropNameInTable="Extended_DescriptionColumn" msprop:Generator_UserColumnName="Extended Description" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="QD-1" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="_columnQD_1" msprop:Generator_ColumnPropNameInRow="_QD_1" msprop:Generator_ColumnPropNameInTable="_QD_1Column" msprop:Generator_UserColumnName="QD-1" type="xs:decimal" minOccurs="0" />
              <xs:element name="VD-1" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="_columnVD_1" msprop:Generator_ColumnPropNameInRow="_VD_1" msprop:Generator_ColumnPropNameInTable="_VD_1Column" msprop:Generator_UserColumnName="VD-1" type="xs:decimal" minOccurs="0" />
              <xs:element name="MRG-1" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="_columnMRG_1" msprop:Generator_ColumnPropNameInRow="_MRG_1" msprop:Generator_ColumnPropNameInTable="_MRG_1Column" msprop:Generator_UserColumnName="MRG-1" type="xs:decimal" minOccurs="0" />
              <xs:element name="QD" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnQD" msprop:Generator_ColumnPropNameInRow="QD" msprop:Generator_ColumnPropNameInTable="QDColumn" msprop:Generator_UserColumnName="QD" type="xs:decimal" minOccurs="0" />
              <xs:element name="VD" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnVD" msprop:Generator_ColumnPropNameInRow="VD" msprop:Generator_ColumnPropNameInTable="VDColumn" msprop:Generator_UserColumnName="VD" type="xs:decimal" minOccurs="0" />
              <xs:element name="MRG" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnMRG" msprop:Generator_ColumnPropNameInRow="MRG" msprop:Generator_ColumnPropNameInTable="MRGColumn" msprop:Generator_UserColumnName="MRG" type="xs:decimal" minOccurs="0" />
              <xs:element name="QD-ORC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="_columnQD_ORC" msprop:Generator_ColumnPropNameInRow="_QD_ORC" msprop:Generator_ColumnPropNameInTable="_QD_ORCColumn" msprop:Generator_UserColumnName="QD-ORC" type="xs:decimal" minOccurs="0" />
              <xs:element name="VD-ORC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="_columnVD_ORC" msprop:Generator_ColumnPropNameInRow="_VD_ORC" msprop:Generator_ColumnPropNameInTable="_VD_ORCColumn" msprop:Generator_UserColumnName="VD-ORC" type="xs:decimal" minOccurs="0" />
              <xs:element name="MRG-ORC" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="_columnMRG_ORC" msprop:Generator_ColumnPropNameInRow="_MRG_ORC" msprop:Generator_ColumnPropNameInTable="_MRG_ORCColumn" msprop:Generator_UserColumnName="MRG-ORC" type="xs:decimal" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:tblProjectosProduto" />
      <xs:field xpath="mstns:id" />
    </xs:unique>
    <xs:unique name="RProjectos_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:RProjectos" />
      <xs:field xpath="mstns:Code" />
    </xs:unique>
    <xs:unique name="RProjectosProdutos_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:RProjectosProdutos" />
      <xs:field xpath="mstns:Code" />
    </xs:unique>
  </xs:element>
</xs:schema>